// ScriptFile.h: interface for the CScriptFile class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SCRIPTFILE_H__7294E126_02E1_4EC5_9619_0B1446A249CB__INCLUDED_)
#define AFX_SCRIPTFILE_H__7294E126_02E1_4EC5_9619_0B1446A249CB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <Afxtempl.h>
#include <fstream>
#include "scriptstruct.h"

using namespace std;

#pragma warning(disable:4290)

class CScriptFile  
{
public:
	CScriptFile();
	virtual ~CScriptFile();

	void ReadScriptFile(CString strFileName) throw(CString);
private:
	void CaculateEquipment() throw(CString);
	void Set();
	Acad::ErrorStatus Draw();
	AcGePoint3d CaculatePoint(AcGePoint3d pt);
	void ConnectString(CString &strX, CString &strY, CString &strZ, PEQUIPMENTCOMPONENT pEC);
	PEQUIPMENTCOMPONENT FindCom(CString strNum, int i);
	void Anasys();
	AcGeVector3d CaculateVector(AcGeVector3d vector);
	void DeleteAll();
	double GetValue(CString str);
	void CaculateTriangle(PEQUIPMENTCOMPONENT pEC) throw(CString);
	void CaculateBox(PEQUIPMENTCOMPONENT pEC) throw(CString);
	void CaculateColumn(PEQUIPMENTCOMPONENT pEC) throw(CString);
	void CaculateCone(PEQUIPMENTCOMPONENT pEC) throw(CString);
	CString GetStrAt(CString strText,int i);
	void ReadTriangle(const CString &str) throw(CString);
	void ReadBox(const CString &str) throw(CString);
	void ReadCone(const CString &str) throw(CString);
	void ReadColumn(const CString &str) throw(CString);

private:
	void SaveOsnapPoint() throw(CString);
	bool IsValueString(CString str);
	CStdioFile file;
	CList<PEQUIPMENTCOMPONENT, PEQUIPMENTCOMPONENT> m_equipcom;
	CList<PEQUIPMENT, PEQUIPMENT> m_equipment;
	CList<POSNAPPOINT, POSNAPPOINT> m_OsnapPoint;
	AcGePoint3d m_basepoint;
	AcGeVector3d m_basevector;
};



#endif // !defined(AFX_SCRIPTFILE_H__7294E126_02E1_4EC5_9619_0B1446A249CB__INCLUDED_)
